home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_elevswitch2.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  69 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_ElevSwitch2.cog
  4. #
  5. # This elevator will go up to its next frame and hold there.  The elevator can be recalled to a floor by hitting the
  6. # respective "Call" button.
  7. #
  8. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.     message    crossed
  13.     message    activate
  14.     message    arrived
  15.  
  16.     surface    lower_adjoin0    linkid=1
  17.     surface    lower_adjoin1    linkid=1
  18.     surface    lower_adjoin2    linkid=1
  19.     surface    call0                linkid=1
  20.     surface    call1                linkid=1
  21.     surface     call2                linkid=1
  22.     surface    call3                linkid=1
  23.  
  24.     thing        elevator            desc=elevator_object
  25.  
  26.     int        curframe=0        Local
  27.     flex        start_wait=0.25        desc=pause_before_moving_up
  28.     flex        speed=4.0
  29. #    sound        wav0=lvrclik1.wav
  30. end
  31.  
  32. # ========================================================================================
  33.  
  34. code
  35. activate:                        // If player presses button
  36.     if (GetWallCel(call0) == 1) return;
  37.     if (GetSenderId() != 1) return;
  38.     setwallcel(call0,1);
  39.     setwallcel(call1,1);
  40.     setwallcel(call2,1);
  41.     setwallcel(call3,1);
  42.     // PlaySoundPos(wav0, GetSurfaceCenter(GetSenderRef()), 1, -1, -1, 0);
  43.     curframe=getcurframe(elevator);
  44.     movetoframe(elevator, 1-curframe, speed);
  45.     stop;
  46.  
  47. # ........................................................................................
  48.  
  49. arrived:
  50.     setwallcel(call0,0);
  51.     setwallcel(call1,0);
  52.     setwallcel(call2,0);
  53.     setwallcel(call3,0);
  54.     // PlaySoundPos(wav0, GetSurfaceCenter(GetSenderRef()), 1, -1, -1, 0);
  55.     stop;        
  56.  
  57. # ........................................................................................
  58.  
  59. crossed:                        // If player crosses adjoin(s)
  60.     if (IsThingMoving(elevator)) return;
  61.     sleep(start_wait);                // pause before moving up
  62.  
  63.     curframe=getcurframe(elevator);
  64.     movetoframe(elevator, 1-curframe, speed);
  65.     stop;
  66.  
  67. end
  68.  
  69.